package net.xdclass.video.crawler.controller;

import net.xdclass.video.common.Result;
import net.xdclass.video.crawler.service.MoviesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/movies")
public class MoviesController {
    @Autowired
    private MoviesService movieService;
    //电影
    @PostMapping("/movie")
    public Result movieCrawling(){
        movieService.movie();
        return Result.success();
    }
    //电视剧
    @PostMapping("/teleplay")
    public Result teleplayCrawling(){
        movieService.teleplay();
        return Result.success();
    }

    //动漫
    @PostMapping("/animation")
    public Result animationCrawling(){
        movieService.animationCrawling();
        return Result.success();
    }

    //综艺
    @PostMapping("/variety")
    public Result varietyCrawling(){
        movieService.varietyCrawling();
        return Result.success();
    }
}
